//
//  WDWorderOrderPendingVehicleViewModel.m
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/10.
//

#import "WDWorderOrderPendingVehicleViewModel.h"

@implementation WDWorderOrderPendingVehicleViewModel
- (void)initialize {
    [super initialize];
    self.title = @"工单界面";
    
    _reqModel = [WDArrivalSubmitReportReqModel new];
}

- (void)setupData {
    _reqModel.engineerId = @([EDSAppDelegateTool sharedInstance].userInfoModel.id);
    _reqModel.stationId = @([EDSAppDelegateTool sharedInstance].userInfoModel.stationId);
    _reqModel.taskId = @(self.serviceModel.id);
    _reqModel.vehicleVin = self.serviceModel.vehicleVin;
    
}

/// 提交
/// - Parameter completion: completion description
- (void)requestWithSubmitReport:(RequestCompletionBlock)completion {
    @weakify(self);
    WDArrivalSubmitReportRequest *request = [[WDArrivalSubmitReportRequest alloc] initWithModel:self.reqModel];
    [request startWithCompletionBlockWithSuccess:^(__kindof TYZBaseRequest * _Nonnull request) {
        @strongify(self);
        EDSRespondDataEntity *respond = request.responseModelObject;
        if (respond.code == EDS_NETWORK_SUCCESS) {
            
        }
        [self sendResponseObject:request.responseModelObject completion:completion];
    } failure:^(__kindof TYZBaseRequest * _Nonnull request) {
        @strongify(self);
        [self sendResponseObject:request.responseModelObject completion:completion];
    }];
}

@end
